Readme for Replication code for: 

Do local economic benefits of asylum seekers lead to more support for local refugee intake?

Manuscript number 210779

GENERAL NOTE:  The data shared are anonymous with the politicians names removed due to the conditions of the data providers YLE (Finnish broadcasting Company) and Helsingin Sanomat.  Therefore, the data merging process cannot be replicated because it relies on the non-anonymized versions.  The replication code starts with the pre-merged data for all data that contains candidate-level data. 

GENERAL NOTE ABOUT FIGURES:  The R code stores the created figures in the folder.  Figures produced in Stata appear on the screen and can be stored by the replicator upon their appearance.  (Note that Figures D1 a and b take a very long time to run.)

IMPORTANT:  Before replication the working directory should always be set to be the exact same folder where the data and the code are stored.  Also the string "myconfidentialfile" should contain the complete path of file "daF3063e.por".

The replication files for the main paper and the appendices are stored in two separate folders, as follows.

*** MAIN PAPER

Folder "01_main_paper_replication" contains:

* CODE

"code_01_Stata_Main_paper_replication.do"
(a do file to create the used dataset and the analysis using Stata)

"code_02_R_Table_2.R"
(an R script to create the word analysis of Table 2)

* FILES

"data_src_*" files are source data files.

There is 1 source data file missing:
"data_src_CONFIDENTIAL_Mayors.xlsx"
that belongs to YLE and has only been shared with me.  For the replication purposes these data have been shared in a disposable Dropbox folder with the JoP replication specialist.  For future replications, persons wishing to obtain these data should contact the author.

The other "data_*" files are created by the code.

* LOGS

They are in the folder "LOGS".

*** APPENDIX

Folder "02_appendix_replication" contains:

* CODE

"code_03_Stata_Creating_data_JoP_Anom.do"
(a do file to create the used datasets)

"code_04_R_Appendix.R"
(an R script for figures A1 to A7, B1, E2; tables A5, A6)

"code_05_Stata_Tables_A1_A2_A7.do"
(a do file to carry out party-level descriptive analysis in Stata)

"code_06_A08_A09_A10_Descriptives_Tables_A8_to_A10.do"
(a do file to carry out municipality-level descriptive analysis in Stata)

"code_07_Stata_Appendix_D_E_F.do"
(a do file to carry out the analyses performed in appendices D, E, and F)

* FILES

"data_src_*" files are source data files.

There are 2 source data files missing:  
"cbF3063e.pdf" (used for Tables A3, A4)
"daF3063e.por" (used for Tables A5, A6).
They rely on data collected by the Finnish daily tabloid Iltalehti, stored by the Finnish Social Science Data Archive.  These data don't belong to me and I don't have the permission to share them.  For JoP replication purposes these data have been shared in a disposable Dropbox file.  For future replication purposes the persons wishing to obtain these data should contact the author.

The other "data_*" files are created by the code.

"kunta1000k_2019.*" files are used to create figure A1.

* LOGS

They are in the folder "LOGS".
